
uniform float speed;
uniform sampler2D image;
uniform vec4 color;
uniform float repeat;
// uniform float time;

czm_material czm_getMaterial(czm_materialInput materialInput){
  czm_material material = czm_getDefaultMaterial(materialInput);
  vec2 v_st = materialInput.st; // 获取uv坐标

  float time = fract(czm_frameNumber * speed / 1000.0);
  vec4 colorImage = texture2D(image , vec2( fract( v_st.t * repeat - time), v_st.t ) );
  
  if(color.a == 0.0){
    material.alpha = colorImage.a;
    material.diffuse = colorImage.rgb;
  }else{
    material.alpha = colorImage.a * color.a;
    material.diffuse = max(color.rgb * material.alpha * 1.5, color.rgb);
  }
      
  return material;
}